import axios from "./config"



//登录
//这里暴露出去的是一个对象，对象里有login方法
export const login = (username, password) => axios({
    url:"/users/login",
    method:"post",
    data:{
        username,
        password
    }
})

//获取登录日志
export const getLoginLog = () => axios.get("/getloginlog")

//获取用户菜单
export const getMenuList = () => axios.get("/permission/getMenuList")

// -----------------------------------------------------------------------
//获取学员信息菜单
export const getStuList = (params={count:5}) => axios({
    url:"/students/getstulist",
    params
})

//增加学员信息
export const addStu = (data) => axios({
                        url:"/students/addstu",
                        method:"post",
                        data:data})


//删除学员信息
export const delStu = (sId) => axios.get(`/students/delstu?sId=${sId}`)

//修改学员信息
export const editStu = (updated) => axios({
                        url:"/students/updatestu",
                        method:"post",
                        data: updated
})

//搜索学员
export const searchStu = (key) => axios.get(`/students/searchstu?key=${key}`)

//获取班级列表
export const getClasses = () => axios.get(`/students/getclasses`)